var config = { keepZoomRatio: false,
              layer: { "width": "100%", "height": "100%", "top": 0, "left": 0 },
              //audio: { enable: true, playURl: "media/happy.wav",cycleURL: "media/circulation.wav" },
              setTime: { 
                walkToThird: 6000, walkToMiddle: 6500, walkToEnd: 6500, 
                walkTobridge: 2000, bridgeWalk: 2000, 
                walkToShop: 1500, walkOutShop: 1500, 
                openDoorTime: 800, shutDoorTime: 500, 
                waitRotate: 850, waitFlower: 800 },
                snowflakeURl: ["images/flake/snowflake1.png",
                              "images/flake/snowflake1.png",
                              "images/flake/snowflake1.png", 
                              "images/flake/snowflake1.png", 
                              "images/flake/snowflake1.png", 
                              "images/flake/snowflake1.png"] 
            };
var debug = 0;
if (debug) { $.each(config.setTime, function(key, val) { config.setTime[key] = 500 }) }
if (config.keepZoomRatio) { 
  var proportionY = 900 / 1440; 
  var screenHeight = $(document).height(); 
  var zooomHeight = screenHeight * proportionY; 
  var zooomTop = (screenHeight - zooomHeight) / 2;
    config.layer.height = zooomHeight;
    config.layer.top = zooomTop;
}
var instanceX;
var container = $("#content");
container.css(config.layer);
var visualWidth = container.width();
var visualHeight = container.height();
console.log(visualWidth,visualHeight);
$(".button").css("top",visualHeight/2).css("left",visualWidth/2);
//var getValue = function(className) { var $elem = $("" + className + ""); return { height: $elem.height(), top: $elem.position().top } };
//var pathY = function() { var data = getValue(".a_background_middle"); return data.top + data.height / 2 }();
//var bridgeY = function() { var data = getValue(".c_background_middle"); return data.top }();
  // 动画结束事件
 var animationEnd = (function() {
     var explorer = navigator.userAgent;
     if (~explorer.indexOf('WebKit')) {
         return 'webkitAnimationEnd';
     }
     return 'animationend';
 })();